package cn.weiwei.WHadoop.hdfs.filesystem;

import org.apache.hadoop.fs.Path;
import org.apache.hadoop.fs.PathFilter;

/**
 * @author WangWeiwei
 * @version 1.0
 * @sine 17-2-12
 * 用于排除正则表达式路径
 */
public class RegexExcludePathFilter implements PathFilter{

    private final String regex;

    public RegexExcludePathFilter(String regex){
        this.regex = regex;
    }

    @Override
    public boolean accept(Path path) {
        return !path.toString().matches(regex);
    }
}
